package org.realogic.cfm.spring;

import java.sql.Date;

import org.springframework.core.convert.converter.Converter;

public class StringToDateConverter implements Converter<String, Date> {

	public Date convert(String value) {
		Date temp = null;
		if (value != null && !value.trim().equals("") && !value.equals("null")) {
			try {
				temp = Date.valueOf(value.trim());
			} catch (Exception e) {
				temp = null;
			}
		}
		return temp;

	}
}
